package o;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class dqp extends dpn<Boolean, Boolean> {
    protected /* synthetic */ Object ˋ(Context context, Object obj) throws InterruptedException {
        return ˎ(context, (Boolean) obj);
    }

    protected /* synthetic */ Object ॱ(Context context) throws InterruptedException {
        return ˋ(context);
    }

    protected Boolean ˋ(Context context) {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) ContentManager.getInstant().getContext().getSystemService("connectivity")).getActiveNetworkInfo();
        if (activeNetworkInfo == null || !activeNetworkInfo.isConnected() || !dno.ॱ(activeNetworkInfo.getType()) || doo.ᐝ(ContentManager.getInstant().getContext()) || !dvt.ˏ().ʻ() || dvt.ˏ().ˎ()) {
            return Boolean.valueOf(false);
        }
        return Boolean.valueOf(true);
    }

    protected Boolean ˎ(Context context, Boolean bool) {
        NetworkInfo ˊ = dno.ˊ(context);
        if (ˊ != null && dno.ॱ(ˊ.getType())) {
            if (doo.ᐝ(context)) {
                Logger.ˎ("WlanReserveTask", "the wifi is metered,give up continue to download");
                return Boolean.valueOf(false);
            } else if (!dvt.ˏ().ʻ() || dvt.ˏ().ˎ()) {
                return Boolean.valueOf(false);
            } else {
                dvt.ˏ().ˋॱ();
            }
        }
        while (dhq.ॱ().ˎ()) {
            boolean z;
            if (dvt.ˏ().ॱॱ()) {
                z = true;
            } else {
                z = false;
            }
            if (z) {
                if (Logger.ˎ()) {
                    Logger.ˏ("WlanReserveTask", "wlan task is downloading,sleep for 2000ms");
                }
                try {
                    Thread.sleep(2000);
                } catch (Throwable e) {
                    Logger.ˋ("WlanReserveTask", "wlan task is downloading,sleep interrupted", e);
                    return Boolean.valueOf(false);
                }
            }
            Logger.ˎ("WlanReserveTask", "wlan task download end,finish WlanReserveTask");
            return Boolean.valueOf(true);
        }
        return Boolean.valueOf(false);
    }

    protected void ˏ(Context context, Boolean bool, Boolean bool2) {
    }
}
